Learning Flex Basics (Part 2): Creating a Simple Calculator with Macromedia Flex
Table of Contents
- Introduction
- Building the Calculator
- Create the Application Object
- Add a Panel for the Calculator
- Add the Calculator Display
- Add a Grid to Lay Out the Buttons
- Add the Calculator Buttons
- Create the CalculatorController Class
- Add Properties to the Controller Class
- Add Controller Methods
- Instantiate the CalculatorController Class
- Complete Code Listing for calculator.mxml
- Complete Code Listing for CalculatorController.as
- Where to Go From Here
Add a Panel for the Calculator
Generally, you place the visual components of your Flex application
inside containers,
which provide bounding boxes for text, controls, images, and other media
elements. Here, you will use a Panel container that provides
the overall visual wrapper for most applications. You will also use the
title property
of Panel, which provides title text to display in a title bar, automatically
included at the top of the panel.
-
Inside the Application block, add a Panel block with the title property equal to Calculator:
<mx:Panel title="Calculator"> </mx:Panel>